﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace GerPlayHouse
{
    public class FacadeSerial
    {
        private static FacadeSerial instance;
        
        private string dadosPorta;

        public string DadosPorta
        {
            get { return dadosPorta; }
            set { dadosPorta = value; }
        }

        private FacadeSerial(){ }

        public static FacadeSerial Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new FacadeSerial();
                }
                return instance;
            }
        }

        public void enviarStringPorta(string texto) {
            try{
                ConexaoSerial.Instance.enviarStringPorta(texto);
            }
            catch (Exception e)
            {
                throw e;
            }
        }

        public string obterStringPorta() {
            try{
                return ConexaoSerial.Instance.obterStringPorta();
            }
            catch (Exception e)
            {
                throw e;
            }
        }

        public void fecharPorta() {
            try{
                ConexaoSerial.Instance.fecharPorta();
            }
            catch (Exception e)
            {
                throw e;
            }
        }
    }
}
